package com.fowo.api.sys.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fowo.api.sys.entity.SysTask;
import com.fowo.api.sys.model.SysTaskItemVo;
import com.fowo.api.sys.model.SysTaskSearch;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface SysTaskMapper extends BaseMapper<SysTask> {
    Page<SysTaskItemVo> pageSearch(@Param("page") Page page, @Param("search") SysTaskSearch search);

    List<SysTaskItemVo> search(@Param("search") SysTaskSearch search);

    int countByCode(@Param("code") String code, @Param("excludeId") Long excludeId);

    List<SysTask> selectAll();

    void updateStartExecutions(@Param("id") Long id, @Param("workerId") String workerId, @Param("executionSyncId") String executionSyncId);

    void updateEndExecutions(@Param("id") Long id);
}
